<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="p" uri="/WEB-INF/tld/page.tld" %>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>小票打印</title>
<jsp:include page="/header.jsp"></jsp:include>
<link href="${basePath }/css/ui.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
	$(function() {
		
	});
	
	function query() {
		$(".table_list").load("${basePath}/print/list.htm", {
			orderNo:$("#orderNo").val(),
			pageNo:$("#pageNo").val()
		})
	}
	
	function turnpage(pageNo) {
		$("#pageNo").val(pageNo);
		query();
	}
	
	function reset() {
		$("#orderNo").val("");
	}
	
	function detail(oid, cid, type) {
		var type_display = "";
		if(type==1) type_display = "scat";
		else if(type==3) type_display = "advance";
		else if(type==4) type_display = "buyback";
		var url = "";
		if( type == 1 ) {
			url = "${basePath}/trade/"+type_display+"_detail.htm?&print=1&orderId="+oid+"&customerId="+cid;
			window.open(url);
		} else {
			url = "${basePath}/trade/"+type_display+"_detail.htm?&orderId="+oid+"&customerId="+cid;
			var form = $("<form action='${basePath}/print/detail.htm' method='post'></form>")
			form.append("<input type='hidden' name='url' value='"+url+"'>");
			//form.append("<input type='hidden' name='orderId' value='"+oid+"'>");
			//form.append("<input type='hidden' name='customerId' value='"+cid+"'>");
			form.submit();
		}
	}
</script>

</head>
<body>
    <div class="main">
     	<div class="cont">
		    <h2 class="title">查询条件：</h2>
		    <div class="ui_sel clearfix">
		    	<input type="hidden" id="pageNo">
		    	<div class="label_box fl">
		            <span class="sel_label fl">交易号：</span>
		            <input id="orderNo" type="text">
		        </div>
		        
		        <a href="javascript:;" class="green_btn btn fl" onclick="query();">查询</a>
		        <a href="javascript:;" class="yellow_btn btn fl" onclick="reset();">清空</a>
		    </div>
		    <div class="ui">
		        <jsp:include page="table.jsp"/>
		    </div>
		</div>
		<div id="page-div">
		<p:page map="${page }"></p:page>
		</div>
</body>
</html>